#pragma once

typedef unsigned char       BYTE;

/*
An interface for accessing a bitmap image.
*/
class IBitmapPicture
{
public:
	/*
	Returns the width of the bitmap.
	*/
	virtual int GetRawWidth() const = 0;

	/*
	Returns the height of the bitmap.
	*/
	virtual int GetRawHeight() const = 0;

	/*
	Returns the number of bytes on a scan line.
	
	Usage: This value, multiplied by the height of the picture,
	gives the size of the memory buffer.

	See also
	GetOffsetX, GetOffsetY
	*/
	virtual int GetBytesInRow() const = 0;

	/*
	Returns a pointer to the bitmap bytes (memory buffer).
	*/
	virtual const BYTE* GetData() const = 0;

	/*
	Returns the increment that moves the pointer p in the data buffer to
	the adjacent pixel at the right.
	Operation on coordinates: (x, y) -> (x + 1, y)
	Operation on pointers: p -> p + GetOffsetX()

	This value, for BMP format, is equal to the number of bytes in pixel.
	*/
	virtual int GetOffsetX() const = 0;

	/*
	Returns the increment that moves the pointer p in the data buffer to
	the adjacent pixel above.
	Operation on coordinates: (x, y) -> (x, y + 1)
	Operation on pointers: p -> p + GetOffsetY()

	This value, for BMP format, is the number of bytes in one scan line.

	Remarks
	The method GetOffsetY() returns value in color components.
	For 24-bit RGB, the color component is also one byte, and both methods
	return the same number. If in the future there will be need to support
	for example 48-bit RGB format, then these two methods would be different
	because the color component occupies two bytes. (GUID_WICPixelFormat48bppRGB)

	See also
	GetBytesInRow
	*/
	virtual int GetOffsetY() const = 0;
protected:
	IBitmapPicture();

	/*
	The objects may not be deleted using the pointer, since the class is a pure interface.
	*/
	~IBitmapPicture();
private:
	/*
	Copy constructor is prohibited.
	*/
	IBitmapPicture(const IBitmapPicture&);

	/*
	Assingment operator is prohibited.
	*/
	void operator=(const IBitmapPicture&);
};